<script setup lang="ts">
import { onLaunch, onShow } from '@dcloudio/uni-app'
import { useUserStore } from '@/stores/user'
import { initLocale } from '@/utils/i18n'
import { initPageTitleListener } from '@/utils/pageTitle'
import { initTabBarListener } from '@/utils/tabBar'

const userStore = useUserStore()

onLaunch(() => {
  console.log('App Launch')
  userStore.init()
  initLocale()
  initPageTitleListener()
  initTabBarListener()
})

onShow(() => {
  console.log('App Show')
  userStore.checkLoginStatus()
})
</script>

<style>
/* 全局样式 */
page {
  background-color: #f8f9fa;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
</style>
